-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create @helia/block-brokers package (#341) #342
feat: create @helia/block-brokers package (#341) #342
Conversation
- moves `packages/helia/src/block-brokers/` to `packages/block-brokers` - adds necessary boilerplate files and config for `@helia/block-brokers` package - updates all references to old block-brokers location in `package/helia` and top level config files
2f262f1
to
9f2bccc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initial review, 4 files not fully looked at
* Networked storage wraps a regular blockstore - when getting blocks if the | ||
* blocks are not present Bitswap will be used to fetch them from network peers. | ||
*/ | ||
export class NetworkedStorage implements Blocks, Startable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still need to replace networked-storage in helia
core right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its still there, I just duplicated this file. I figured we could discuss if it makes sense to pull into a @helia/utils
package or something since it's used in multiple places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think networked storage is just a wrapper for the blockStore and the blockBrokers (see https://github.com/ipfs/helia#-system-diagram), so we should be able to encapsulate networked-storage stuff within block-brokers for Helia fully, but we should get Alex's input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes I see, moving it seems to make sense, if Alex wants something else we can change before merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved in e18e820
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love having NetworkedStorage and default-hashers in @helia/block-brokers
since they are not block brokers, but let's merge this to get a next
version out and figure out a refactor before final release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another file that I had duplicated @SgtPooki, it's also used in helia.ts
Davids-Computer helia % git grep -i "default-hashers"
packages/block-brokers/test/block-broker.spec.ts:import { defaultHashers } from '../src/utils/default-hashers.js'
packages/block-brokers/test/utils/networked-storage.spec.ts:import { defaultHashers } from '../../src/utils/default-hashers.js'
packages/block-brokers/typedoc.json: "./src/utils/default-hashers.ts"
packages/helia/package.json: "types": "./dist/src/utils/default-hashers.d.ts",
packages/helia/package.json: "import": "./dist/src/utils/default-hashers.js"
packages/helia/src/helia.ts:import { defaultHashers } from './utils/default-hashers.js'
packages/helia/typedoc.json: "./src/utils/default-hashers.ts"
Could move over and just export from block-brokers
like NetworkedStorage
files: block-brokers/ from helia package
All tests pass locally. |
I'm still unclear on how release-please will handle the publishing of |
- moves `packages/helia/src/block-brokers/` to `packages/block-brokers` - adds necessary boilerplate files and config for `@helia/block-brokers` package - updates all references to old block-brokers location in `package/helia` and top level config files --------- Co-authored-by: Russell Dempsey <[email protected]> Co-authored-by: Alex Potsides <[email protected]>
packages/helia/src/block-brokers/
topackages/block-brokers
@helia/block-brokers
packagepackage/helia
and top level config files